//代码编辑器
<template>
  <div class="editor">
    <monaco :codes="content"
            :readOnly="false"
            @update="getValue"> </monaco>
  </div>
</template>
<script>
export default {
  data () {
    return {
      content: sessionStorage.value ? JSON.parse(sessionStorage.value) : ''
    }
  },
  methods: {
    getValue (val) {
      sessionStorage.value = JSON.stringify(val)
    }
  }
}
</script>
<style lang="less" scoped>
.editor {
  height: 50%;
  width: 50%;
}
</style>
